import { IElmentRoot } from "../../ADCore/Interfaces/IRole";
import { IEffect } from "../../ADCore/Interfaces/IEffect";
import EffectBase from "./EffectBase";
/**价值展示特效 */
export default class ValueNumber extends EffectBase implements IEffect{
    
    no: number;
    isDestroy: boolean;
    spriteBase: any;

    constructor(value) {
        super();
        var sprite = new Laya.Text(); 
        
        sprite.text =(value>=0? "+":"")+value; 
        sprite.font = "default";
        sprite.fontSize = 150;

        sprite.scaleX = 0.3;
        sprite.scaleY = 0.3;
        sprite.pivot(20, 20);
        sprite.zOrder = 99;
        this.spriteBase=sprite;
    }
    play() {
        Laya.Tween.to(this.spriteBase, { y: this.spriteBase.y - 15, scaleX: 1, scaleY: 1 }, 1200, Laya.Ease.bounceInOut, Laya.Handler.create(this, () => {
            this.destroy();
        }));
    } 
}